package com.littcore.saap.system.dao;

import java.util.List;

import com.littcore.dao.GenericHibernateDao;
import com.littcore.saap.system.po.TenantConfig;

public class TenantConfigDao extends GenericHibernateDao<TenantConfig, Integer> {
	
  public void deleteByTenantId(int tenantId)
  {
      super.deleteBy("tenantId", tenantId);
  }
  
  public TenantConfig loadByTenantAndCode(int tenantId, String code)
  {
      String hql = "from TenantConfig where tenantId=? and code=?";
      return super.uniqueResult(hql, new Object[]{tenantId, code}, TenantConfig.class);
  }
  
	public List<TenantConfig> listByTenant(int tenantId)
	{
	    String hql = "from TenantConfig where tenantId=?";
	    List<TenantConfig> tenantConfigList = super.listAll(hql, new Object[]{tenantId});
	    return tenantConfigList;
	}
	
}
